Sort an array of objects in JavaScript
Ever wanted to sort an array of objects, but felt like it was too complex? Here's a robust solution for just that.
30 seconds of code provides a curated collection of short code snippets for all your development needs. Our collection spans many topics, ranging from simple coding problems to theoretical concepts and development techniques.
Ever wanted to sort an array of objects, but felt like it was too complex? Here's a robust solution for just that.
Learn how to perform various transformations on the keys of a JavaScript object.
Take a deeper dive into React's rendering process and understand the basics behind the popular JavaScript framework.
Testing React components that update asynchronously is pretty common. Learn how to deal with common issues and speed up your testing.
Learn the differences between JavaScript ES6 arrow functions and regular functions and how they affect event listener callbacks.
Learn how to programmatically copy text to clipboard with a few lines of JavaScript and level up your web development skills.
Learn how to implement array zipping, a grouping of elements based on position in the original arrays, and its inverse, unzipping.
Renders an accordion menu with multiple collapsible content elements.
Creates a card that shifts on hover.
Pick up a few new tricks which you can use to clone arrays in JavaScript.
Learn different ways to memoize function calls in JavaScript as well as when to use memoization to get the best performance results.
JavaScript provides a handful of native data structures that you can start using in your code right now.
Group array elements into two or more arrays arrays, depending on the provided function's return value.
Renders a tree view of a JSON object or array with collapsible content.
Convert the data from an HTML form into a JavaScript object or serialize it into a query string.
Create your own static file server with Node.js in just 70 lines of code.
Learn how to implement the singleton design pattern in JavaScript, using the Proxy object.
Renders a textarea component with a word limit.
Asynchronously looping over arrays in JavaScript comes with a few caveats you should watch out for.
Learn how to manipulate JavaScript objects by flattening or unflattening them.
Learn how to perform HTTP GET, POST, PUT, and DELETE requests in JavaScript.
Learn how to use the JavaScript ES6 spread syntax to converting iterables to arrays and level up your code today.
Groups the given data into k
clusters, using the k-means clustering algorithm.
Take a deeper dive into React's rendering process and understand the role of the Context API and Redux in it.